/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Helper;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

/**
 *
 * @author Nhattruong
 */
public class SocketSender {

    Socket _socket;
    DataOutputStream os;

    public SocketSender(Socket s) throws IOException {
        _socket = s;
        os = new DataOutputStream(_socket.getOutputStream());
    }

    public void stopSender() throws IOException {
        os.close();
    }

    public void SendMessage(String message) throws IOException {
        os.writeBytes(message);
        os.write(13);
        os.write(10);
        os.flush();
    }
}
